package com.leetCode.tree;

import com.lx.algorithm.Tree.Tree;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Description:
 * Copyright:   Copyright (c)2019
 * Company:     zefu
 *
 * @author: 张李鑫
 * @version: 1.0
 * Create at:   2021-10-22 10:28:47
 * <p>
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2021-10-22     张李鑫                     1.0         1.0 Version
 */
public class IsSymmetric {


    public boolean isSymmetric(TreeNode root) {
        return true;
    }


    /**
     * <p>
     * 迭代方式判断是否对称
     * </p>
     *
     * @param treeNode
     * @return boolean
     * @Author zlx
     * @date 2021/10/22
     */
    public static boolean loop(TreeNode treeNode) {
        return true;
    }

    public static String process(TreeNode treeNode, TreeNode treeNode1) {
        if (treeNode == null) {
            return "#";
        }
        String print = String.valueOf(treeNode.val);
        print += process(treeNode.right, treeNode1);
        if (treeNode1 != treeNode) {
            print += process(treeNode.left, treeNode1);
        }
        return print;
    }

    public static String process1(TreeNode treeNode, TreeNode treeNode1) {
        if (treeNode == null) {
            return "#";
        }
        new LinkedList<>();
        String print = String.valueOf(treeNode.val);
        print += process1(treeNode.left, treeNode1);
        if (treeNode1 != treeNode) {
           print+= process1(treeNode.right, treeNode1);
        }
        return print;
    }


    public static void main(String[] args) {
        TreeNode a = new TreeNode(1);
        TreeNode b = new TreeNode(2);
        TreeNode c = new TreeNode(2);
        TreeNode d = new TreeNode(3);
//        TreeNode e = new TreeNode(4);
//        TreeNode f = new TreeNode(4);
        TreeNode g = new TreeNode(3);

        a.left = b;
        a.right = c;
        b.right = d;
//        b.right =e;
//        c.left =f;
        c.right = g;


        System.out.println();
        System.out.println(process(a, a));
    }


}
